feat(iOS): add fontSize and fontFamily to customStyle - #754
Open
kacperzolkiewski wants to merge 6 commits into
Open
feat(iOS): add fontSize and fontFamily to customStyle#754kacperzolkiewski wants to merge 6 commits into
kacperzolkiewski wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds iOS support for applying fontSize and fontFamily via the existing customStyle mechanism, wiring the new style properties through the JS API, native style application, and HTML import/export, plus updating the example app and Maestro flows to exercise the feature.
Changes:
- Extend
customStyle(events +setStyle) to includefontSizeandfontFamily. - Apply and round-trip custom font styling on iOS (native styling + HTML parser/serializer updates).
- Update example toolbar UI and add Maestro visual flows for custom font verification.
Reviewed changes
Copilot reviewed 15 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/web/useOnChangeState.ts | Adds default fontSize/fontFamily fields to web customStyle state payload. |
| src/types.ts | Extends public TS event and instance types to include fontSize/fontFamily. |
| src/spec/EnrichedTextInputNativeComponent.ts | Updates codegen spec event payloads to carry fontSize/fontFamily. |
| src/native/EnrichedTextInput.tsx | Extends setStyle command payload to send fontSize/fontFamily to native. |
| ios/styles/CustomStyle.mm | Applies font size/family overrides (including typing attrs) while preserving traits. |
| ios/htmlParser/HtmlParser.mm | Serializes/deserializes font-size/font-family within custom-style spans. |
| ios/EnrichedTextInputView.mm | Emits new fields in state/context-menu events and accepts them in setStyle. |
| ios/customStyleData/CustomStyleData.mm | Stores/merges/compares/hashes/copies fontSize/fontFamily in custom style data. |
| ios/customStyleData/CustomStyleData.h | Adds fontSize/fontFamily properties to custom style data model. |
| apps/example/src/constants/editorConfig.ts | Extends default example editor style state with font fields. |
| apps/example/src/components/Toolbar.tsx | Adds font size/family toolbar buttons and picker wiring. |
| apps/example/src/components/FontSizePickerRow.tsx | New example picker row for selecting/clearing font size. |
| apps/example/src/components/FontFamilyPickerRow.tsx | New example picker row for selecting/clearing font family. |
| .maestro/enrichedText/flows/custom_style_fonts_visual.yaml | Adds visual regression flow for HTML-driven custom font styles. |
| .maestro/enrichedInput/flows/custom_style_fonts_visual.yaml | Adds visual regression flow for interactive font size/family styling. |
Suppressed comments (1)
ios/customStyleData/CustomStyleData.mm:30
- An empty
fontFamilystring is treated as a non-empty custom style (since it’s non-nil), which causes unnecessary styling work and makes it easy for callers to accidentally “set” an empty family. Normalize empty strings tonilwhen merging.
id ffVal = dict[@"fontFamily"];
if (ffVal != nil) {
self.fontFamily =
[ffVal isKindOfClass:[NSString class]] ? (NSString *)ffVal : nil;
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kacperzolkiewski
marked this pull request as ready for review
August 10, 2026 10:42
hejsztynx
reviewed
Aug 11, 2026
hejsztynx
left a comment
Collaborator
There was a problem hiding this comment.
Overall looks great, but it seems like the custom style fonts does not respect system's accessibility settings, I think they should, wdyt?
Screen.Recording.2026-08-11.at.10.36.22.mov
hejsztynx
self-requested a review
August 11, 2026 09:47
hejsztynx
requested changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add fontSize and fontFamily to customStyle
Test Plan
Run example app and experiment with applying
fontSizeandfontFamilycolors through the toolbar across different text styles.Screenshots / Videos
Screen.Recording.2026-08-10.at.11.38.35.mov
Compatibility
Checklist